package ProjectMain;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
public class stream_DATA 
{
	public static void main(String[] args) throws IOException
	{
		//The url to stream data from
		URL url = new URL("https://www.sis.hawaii.edu/uhdad/avail.classes?i=MAN&t=201410&s=PACE");
		//Get the input stream through URL Connection
		URLConnection con = url.openConnection();
		InputStream is = con.getInputStream();
		//Change the name of the file per each type of class
		//I.E. ANSC, ICS, HAW, etc...
		File f = new File("/Users/nathanbutler/Desktop/MUS.csv");
        BufferedWriter output = new BufferedWriter(new FileWriter(f));
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        String line = null;
        while((line = br.readLine()) != null)
        {
        	output.write(line);
        }
        output.close();	
    }
}
